class CourseCategory {
  String id;
  String parentId;
  String name;
  int sort;
  List<CourseCategory> children;

  CourseCategory({
    this.id,
    this.parentId,
    this.name,
    this.sort,
    this.children,
  });

  factory CourseCategory.fromJson(Map<String, dynamic> json) {
    return CourseCategory(
      id: json['id'],
      parentId: json['parentId'],
      name: json['name'],
      sort: json['sort'],
      children: json['children'] == null ? [] : (json['children'] as List).map((e) => CourseCategory.fromJson(e)).toList(),
    );
  }
}
